﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ProtoBuf;

namespace DataSource
{
    [ProtoContract]
    public class Level2Struct
    {
        [ProtoMember(1)]
        public string code {get; set; }
        [ProtoMember(2)]
        public string hq_type_code { get; set; }
        [ProtoMember(3)]
        public DateTime time { get; set; }
        //public DateTime localtime { get; set;}
        [ProtoMember(4)]
        public float price { get; set; }
        [ProtoMember(5)]
        public int count { get; set; }
        [ProtoMember(6)]
        public double amount { get; set; }
        [ProtoMember(7)]
        public double balance { get; set; }
        [ProtoMember(8)]
        public List<float> buy_px { get; set; }
        [ProtoMember(9)]
        public List<float> sell_px { get; set; }
        [ProtoMember(10)]
        public List<int> buy_amount { get; set; }
        [ProtoMember(11)]
        public List<int> sell_amount { get; set; }

        public Level2Struct()
        {
            buy_px = new List<float>(5);
            sell_px = new List<float>(5);
            buy_amount = new List<int>(5);
            sell_amount = new List<int>(5);
        }

    }

    [ProtoContract]
    public class TickStruct
    {
        public string code = "";
        public DateTime time;
        public DateTime localtime;
        public float price = 0;
        public int volume = 0;
        public string direction = ""; //B :buy S:sell
        public string hq_type_code = "";

    }

    public class KLineStruct
    {
        public string code { get; set; }
        public float close { get; set; }
        public float high { get; set; }
        public float low { get; set; }
        public float open { get; set; }
        public int volume { get; set; }
    }

    public enum KPeroid
    {
        Sec10=10,
        Min1=60,
        Min5=300,
        Min15=900,
        Min30=1800,
        Min60=3600,
    }

    public enum DType
    {
        LV2,
        Tick,
        KLine
    }

}
